<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:65:"C:\wamp200\www\xgwnew/application/index\view\order\qiyeindex.html";i:1545276822;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1537861369;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />

</head>
<!--/head-->
<body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://apis.map.qq.com/tools/geolocation/min?key=QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH&referer=鲜果屋"></script>
<script>
//alert("cc");
		  var geolocation = new qq.maps.Geolocation();
     var options = {timeout: 9000};
        var positionNum = 0;
	geolocation.getLocation(showPosition, showErr, options);
	
	function showPosition(position) {
		
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('pre')).innerHTML = JSON.stringify(position, null, 4);
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };
 
        function showErr() {
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('p')).innerHTML = "定位失败！";
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };

	
</script>

	<!--/header-->
 <script src="__PUBLIC__/xsd/js/clipboard.min.js?v=1232"></script>
<style>
.mui-table-view-cell p {
    margin-bottom: 0;
    font-size: 12px;
}
.mui-table-view .mui-media-object {
    line-height: 42px;
    width: 60px !important;
        max-width: 60px;
    height: 60px;
}
.mui-card-header {
    font-size: 12px;
    border-radius: 2px 2px 0 0;
        padding: 5px 10px;
}
</style> <textarea id="foo"  cols="40" wrap="hard" style="     height: 10px;  margin-left: -1000px;margin-bottom: 0;"  >  团购清单    <?php if(is_array($listcopy) || $listcopy instanceof \think\Collection): $k = 0; $__LIST__ = $listcopy;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?>     订单<?php echo $k; ?>-    <?php echo msubstr($vo['user_name'],0,1); ?>   <?php echo msubstr($vo['tel'],0,9); if(is_array($vo['OrderShoplist']) || $vo['OrderShoplist'] instanceof \think\Collection): $i = 0; $__LIST__ = $vo['OrderShoplist'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>   <?php echo $item['good_name']; ?>   <?php echo $item['num']; ?>份      <?php endforeach; endif; else: echo "" ;endif; switch($vo['buystatus']): case "0": ?>未付款<?php break; case "1": ?>已付款<?php break; case "4": ?> 已付款<?php break; endswitch; endforeach; endif; else: echo "" ;endif; ?>      团购地址：http://www.xgw0851.com/index/index/qiye/cid/17      </textarea>
<header class="mui-bar mui-bar-nav">
  <a class=" mui-icon mui-icon-left-nav mui-pull-left" href="<?php echo url('index/index/qiye', ['cid'=>cookie('company_id')]); ?>"></a>
  <h1 class="mui-title">我-订单</h1><button class="btn " data-clipboard-target="#foo" aria-label="复制成功！" style="margin: 0 auto;display: block;">复制团购信息</button>
  <script>      var clipboard = new Clipboard('.btn');    clipboard.on('success', function(e) {    	var msg = e.trigger.getAttribute('aria-label');      console.log(e);    	alert(msg);        e.clearSelection();    });    </script></header>
<div class="mui-content" style="    margin-bottom: 100px;">
  <?php if(is_array($list) || $list instanceof \think\Collection): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <div class="mui-card">
      	<div class="mui-card-header ">
          <div class="mui-ellipsis mui-col-xs-8">订单编号：<?php echo $vo['out_trade_no']; ?></div>
            <div class="mui-col-xs-4 mui-text-right">            	            	<button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" style="font-size:12px;"><?php echo parse_config_value($vo['buystatus'],'pay_status'); ?></button>            	            	</div>
        </div>
      	<div class="mui-card-content">
      		<div class="mui-card-content-inner" style="    padding: 5px 0;">

            <ul class="mui-table-view mui-table-view-chevron">
                <li class="mui-table-view-cell mui-media" onclick='window.location.href = "<?php echo url('index/order/detail',array('id'=>$vo['id'])); ?>"'>
                    <a class="mui-navigate-right">
                        <img class="mui-media-object mui-pull-left" src="<?php echo get_cover($vo['cover_id'],'path'); ?>">
                        <div class="mui-media-body" style="    overflow: initial;">
                            <p><span style='color:red'>¥<?php echo $vo['total']; ?></span></p>
                            <p >下单时间：<?php echo $vo['create_time']; ?></p>
                            <p>收货时间：<?php echo $vo['deliverytime']; ?></p>
                        </div>
                    </a>
                </li>

            </ul>
            <?php switch($vo['buystatus']): case "0": ?>
                  <div class=" mui-text-right" style="padding-right:15px;">
                    <button type="button" onclick='window.location.href = "<?php echo url('index/order/qiyepay',array('id'=>$vo['id'])); ?>"' class="mui-btn mui-btn-warning" style="font-size:12px;">去付款</button>
                                        <button type="button" data-id="<?php echo $vo['id']; ?>" class="mui-btn mui-btn delorder" style="font-size:12px;">删除</button>
                  </div>

                <?php break; endswitch; ?>

        	</div>
      </div>
    </div>
  <?php endforeach; endif; else: echo "" ;endif; ?>

</div>




<!--/#footer-->

<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>

<script>
  mui.init({
    swipeBack:true //启用右滑关闭功能
  });
  $('#scroll').height($(window).height()-44)


  $(function(){
    $('.delorder').on('click', function(){
      var $this = $(this),id = $this.attr('data-id')
      var btnArray = ['否', '是'];
      mui.confirm('您确定要删除该订单吗？', '删除订单', btnArray, function(e) {
        if (e.index == 1) {
            $.post("<?php echo url('index/order/delorder'); ?>", {
                "id": id
            }, function(data) {
                mui.toast('删除成功！')
                setTimeout(function() {
                  location.reload()
                }, 2000);
            }, "json");

        } else {
          return ;
        }
      })


    })
  })


</script>

<?php if(!(empty(config('shop_hours')) || (config('shop_hours') instanceof \think\Collection && config('shop_hours')->isEmpty()))): ?>
<script>
  var time_range = function (beginTime, endTime) {
    var strb = beginTime.split (":");
    if (strb.length != 2) {
      return false;
    }

    var stre = endTime.split (":");
    if (stre.length != 2) {
      return false;
    }

    var b = new Date ();
    var e = new Date ();
    var n = new Date ();

    b.setHours (strb[0]);
    b.setMinutes (strb[1]);
    e.setHours (stre[0]);
    e.setMinutes (stre[1]);

    if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
      return true;
    } else {

      mui.alert("<?php echo config('shop_hours_message'); ?>", '公告');
      $('.mui-popup-buttons').html(' ')
      $('.mui-popup-inner').css('border-radius', '13px')
      return false;
    }
  }

  var shop_hours = "<?php echo config('shop_hours'); ?>";
  var hours_arr = shop_hours.split('-');
  time_range (hours_arr[0], hours_arr[1]);

</script>
<?php endif; if(config('is_rest') == '1'): ?>
<script>
mui.alert("<?php echo config('rest_message'); ?>", '公告');
$('.mui-popup-buttons').html(' ')
$('.mui-popup-inner').css('border-radius', '13px')
</script>
<?php endif; ?>



<script>
  $(function(){
    $('.subsc').click(function(){
      // $.get("<?php echo url('index/clearusersession'); ?>", function(data){
      //   if(data.code == 1){
      //     window.location.href = "http://mp.weixin.qq.com/s/-AzpDTU7eAD24-R5QUP0wg"
      //   }
      // })
      //cookie('goodsmodel_id', $model_id);
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "21":case "22":case "3": ?>
            mui.alert("<img src=<?php echo get_cover(config('frankserviceimg'), 'path'); ?> style='width:100%;'>", '长按扫二维码');
        <?php break; endswitch; if(!(empty($contact_qc) || ($contact_qc instanceof \think\Collection && $contact_qc->isEmpty()))): ?>
            mui.alert('<img src="<?php echo $contact_qc; ?>" style="width:100%;">', '长按扫二维码');
      <?php endif; ?>
    })


    $('.endlimit').each(function(){
      var $this = $(this);
      var stime = $this.attr('data-endtime');
      var starttime = new Date(stime.replace(/-/g,"/"))
      setInterval(function () {
        var nowtime = new Date();
        var time = starttime - nowtime;
        if(time > 0){
          var day = parseInt(time / 1000 / 60 / 60 / 24);
          var hour = parseInt(time / 1000 / 60 / 60 % 24);
          var minute = parseInt(time / 1000 / 60 % 60);
          var seconds = parseInt(time / 1000 % 60);
          $this.html("距结束还有:<span style='color:red'>"+ day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒</span>");
        }

      }, 1000);
    })

    $('.hidecartbtn').each(function(){
      var id = $(this).attr('data-id')
      $('.cartbtn'+id).hide();
    })


  })
</script>

 

 <!-- <?php if(empty(\think\Cookie::get('positioninit')) || (\think\Cookie::get('positioninit') instanceof \think\Collection && \think\Cookie::get('positioninit')->isEmpty())): ?>
 <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
 <script>
   $(function(){
    var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
     geolocation.getIpLocation(showPosition, showErr)

   })

   function showPosition(position) {
     console.log(1111);
     $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
  };
   function showErr() {
     console.log('定位失败');
   };
 </script>
 <?php endif; ?> -->

</body>
</html>
